import { request } from '../utils/request'
import type { StyleTemplate, Category, ApiResponse } from '../types'

// 获取风格模板列表
export const getStyleTemplatesApi = (category?: string, is_premium?: boolean) => {
  const params: any = {}
  if (category) params.category = category
  if (is_premium !== undefined) params.is_premium = is_premium
  
  return request.get<ApiResponse<{ templates: StyleTemplate[] }>>('/style/templates', { params })
}

// 获取单个风格模板
export const getStyleTemplateApi = (id: number) => {
  return request.get<ApiResponse<{ template: StyleTemplate }>>(`/style/templates/${id}`)
}

// 获取分类列表
export const getCategoriesApi = () => {
  return request.get<ApiResponse<{ categories: Category[] }>>('/style/categories')
}